package com.mspbots.rule.queue.timeentry;

import com.mspbots.cw.request.TenantTimeEntryDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName com.mspbots.rule.queue.timeentry.IncludingWordsQueue
 * @Description TODO
 * @Author Jun
 * @Date 2019/8/30 19:27
 * @Version 1.0
 **/
@Slf4j
@Component
public class IncludingWordsQueue extends TimeEntryBaseQueue {

    private static final String RULE_NAME = "IncludingWords";

    @RabbitListener(queues = "trigger.timeEntry.IncludingWords")
    public void onQueue(TenantTimeEntryDTO tenantTimeEntryDTO) {
        log.debug("IncludingWords queue: {}", tenantTimeEntryDTO.getCwTid());
        super.onRule(RULE_NAME, tenantTimeEntryDTO);
    }

//    @RabbitListener(queues = "trigger.timeEntry.IncludingWords")
//    public void onQueue(List<TenantTimeEntryDTO> tenantTimeEntryDTOList) {
//        log.debug("IncludingWords queue: {}", tenantTimeEntryDTOList.size());
//        for (TenantTimeEntryDTO tenantTimeEntryDTO : tenantTimeEntryDTOList) {
//            super.onRule(RULE_NAME,tenantTimeEntryDTO);
//        }
//
//    }

}
